<?php 
namespace Member\Model;
use Think\Model;

class ReplyUndefineModel extends Model {

	protected $_validate = array(
			
	);
	
	protected $_auto = array(
			array('uid', UID, self::MODEL_INSERT, 'string'),
			array('create_time', NOW_TIME, self::MODEL_INSERT, 'string'),
			array('update_time', NOW_TIME, self::MODEL_BOTH, 'string'),
	);
	
	function update() {
		/* 获取数据对象 */
		$data = $this->create();
		if(empty($data)){
			return false;
		}
		/* 添加或新增内容 */
		if(empty($data['id'])){
			if(!$this->add()){
				return false;
			}
		}else {
			if(!$this->save()){
				return false;
			}
		}
		return true;
	}
}